
#include "rngacml.h"
#include <assert.h>

	static int  seed[1]={1234}; /* random generator seed */
    static int  info;
    static int  lseed  = 1;
    static int  state[16];
    static int  lstate = 16;


    /* normal random variable generator */
    void acml_randn(double* x, const int n, const double xmu, const double var)
    {
        assert( var > 0 ); /*  variance must greater than 0 */
        assert( n > 0);    /*  n must greater than 0        */
        drandgaussian(n, xmu, var, state, x, &info);
    }


    /* uniform random variable generator */
    void acml_randu(double* x, const int n, const double a, const double b)
    {
        assert(a <= b); /* a must smaller than b */
        assert(n > 0); /* n must greater than 0 */
        dranduniform(n, a, b, state, x, &info);
    }


    /* set seed */
    void acml_randseed(const int n)
    {
        seed[0] = n;
        drandinitialize(1, 1, seed, &lseed, state, &lstate, &info);
    }